/*
 * Copyright @ 苏州瑞云信息技术有限公司 All rights reserved.
 */
package work.base.innerclass;

/**
 * @author Sakura Shen
 * @description 测试内部类
 * @date 2021/6/21
 */
public class DataOuterClass {

    private String data = "外部类数据";

    private class InnerClass {
//        String data = "内部类数据";
        public InnerClass() {
            System.out.println(DataOuterClass.this.data);
        }
    }

    public InnerClass getInner() {
         return new InnerClass();
    }

    public static void main(String[] args) {
        DataOuterClass outerClass = new DataOuterClass();

        InnerClass inner = outerClass.getInner();

    }

}
